#ifndef POINTITEM_H
#define POINTITEM_H

#include "ShapeItem.h"

class PointItem : public ShapeItem
{
    Q_OBJECT
    Q_ENUMS(PointType)
    Q_PROPERTY(PointType pointType READ pointType WRITE setPointType NOTIFY pointTypeChanged)
    Q_PROPERTY(QPointF pos READ pos WRITE setPos NOTIFY posChanged)

public:
    explicit PointItem(QQuickItem *parent = 0);

    QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *);

    QPointF pos() const { return m_pos; }
    void setPos(const QPointF &p);

    enum PointType { Regular, Control, Mark, Center, Smooth };
    void setPointType(PointType pointType);
    PointType pointType() const { return m_pointType; }

    virtual Type shapeType() const { return ShapeItem::Point; }
signals:
    void posChanged(const QPointF &p);
    void pointTypeChanged(PointType pointType);

private:
    QPointF m_pos;
    PointType m_pointType;
};

#endif // POINTITEM_H
